import App from './App'

import publicJs from '@/static/js/public.js'
uni.publicJs = publicJs;

// #ifndef VUE3
import Vue from 'vue'
import share from './common/share.js'

import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
  ...App
})
// 定义全局过滤器
Vue.filter('formatDate', function(value) {
  if (!value) return '';
  // 创建一个新的Date对象，传入时间戳
  const date = new Date(value);
  // 使用toLocaleDateString转换为本地日期格式
  return date.toLocaleDateString();
});
app.$mount()
// #endif

// #ifdef VUE3

import { createSSRApp } from 'vue'
import * as Pinia from 'pinia';
export function createApp() {
  const app = createSSRApp(App)
    app.use(Pinia.createPinia());
  return {
    app,Pinia
  }
}
// #endif